<?php

/**
 *  
 * @copyright (c) 2012 University of Geneva
 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
 * @author Laurent Opprecht laurent@opprecht.info
 */
defined('MOODLE_INTERNAL') || die;

/**
 * Define emedia structure for backup
 */
class backup_emedia_activity_structure_step extends backup_activity_structure_step
{

    protected function define_structure()
    {

        $elements = array('name', 'intro', 'introformat', 'url', 'snippet', 'options', 'data', 'ctime', 'mtime');
        $emedia = new backup_nested_element('emedia', array('id'), $elements);
        $emedia->set_source_table('emedia', array('id' => backup::VAR_ACTIVITYID));
        $emedia->annotate_files('mod_emedia', 'intro', null); // This file area hasn't itemid
        return $this->prepare_activity_structure($emedia);
    }

}
